import request from '@/utils/request'
import utils from "../../views/js/index";

// 退款审核列表
export function list(query) {
    return request({
        url: '/jxbill/Main/list',
        method: 'get',
        params: query
    })
}

// 财务报表详情
export function reportMsg(query) {
    return request({
        url: '/jxbill/Main/' + query,
        method: 'get',
    })
}

// 退款审核详情
export function RefundInfoes(query) {
    return request({
        url: '/jxfinance/RefundInfoes/' + query,
        method: 'get',
    })
}

// 导出查询列表
export function downloadrefund(url,query) {
    request({
        url: url,
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        data: query,
        responseType: 'blob'
    }).then(res => {
        const content = res;
        const blob = new Blob([content]);
        if ("download" in document.createElement("a")) {
            const elink = document.createElement("a");
            elink.download = `订单-${utils.utils.NewDate()}下载.xlsx`;
            elink.style.display = "none";
            elink.href = URL.createObjectURL(blob);
            document.body.appendChild(elink);
            elink.click();
            URL.revokeObjectURL(elink.href);
            document.body.removeChild(elink);
        } else {
            navigator.msSaveBlob(blob, 'filename');
        }
    })
}


